#ifndef __TRIGGER__
#define __TRIGGER__

#include "IUtility.h"
#include "ISysResources.h"
#include "IPacket.h"

class CGtTimer : public virtual ITrigger
{
INIT_CLASS_PRODUCT( CGtTimer )
public:
	const bool Init(const void * pvdPara, char * pszMsgTxt, int iMsgTxtSize);
	const void UnInit();
	void Trigger(long iValue);
	unsigned long Wait(unsigned long iInterval);
	void * TriggerHandle();
private:
	LARGE_INTEGER m_liDueTime;
	long long m_llInterval;
	HANDLE m_SignalHd[1];
};

class CGtSemaphore : public virtual ITrigger
{
INIT_CLASS_PRODUCT( CGtSemaphore )
public:
	const bool Init(const void * pvdPara, char * pszMsgTxt, int iMsgTxtSize);
	const void UnInit();
	void Trigger(long iValue);
	unsigned long Wait(unsigned long iInterval);
	void * TriggerHandle();
private:
	long long m_llTriggerCount;
	long long m_llSimultaneouslyTriggerCount;
	HANDLE m_SignalHd[1];
};

#endif//__TRIGGER__